package com.xcyy.zjdxmjk.zjdxmjk.common;



import com.xcyy.zjdxmjk.zjdxmjk.VO.ResultVO;


/**
 * 描述:
 *result 封装
 * @author Alec
 * @create 2019-08-14 10:16
 */
public  class ResultVOUtil {
    public static ResultVO success(Object object){
        ResultVO resultVO=new ResultVO();
        resultVO.setCode(0);
        resultVO.setMsg("成功");
        resultVO.setData(object);
        return resultVO;
    }
    public static  ResultVO success(){
        return success(null);
    }
    public static ResultVO successforPage(Object object, Integer totalPage){
        ResultVO resultVO=new ResultVO();
        resultVO.setCode(0);
        resultVO.setMsg("成功");
        resultVO.setData(object);
        resultVO.setTotalPage(totalPage);
        return resultVO;
    }
    public static ResultVO error(Integer code,String msg){
        ResultVO resultVO =new ResultVO();
        resultVO.setCode(code);
        resultVO.setMsg(msg);
        return resultVO;
    }
}